package com.socket.clientsocket
{
	import flash.events.Event;
	import flash.utils.ByteArray;
	
	/**
	 * 客户端网络回调接口
	 * @author liangxuhu
	 * 
	 */	
	public interface IClientSocketHandler
	{
		 /**
		  *网络连接消息 
		  * @param errorCode
		  * @param errorDesc
		  * @param clientSocket
		  * @return 
		  * 
		  */		
		 function onSocketConnect(errorCode:int,errorDesc:String,clientSocket:IClientSocket):Boolean;
		 /**
		  *网络读取消息 
		  * @param mainCmdID
		  * @param subCmdID
		  * @param buffer
		  * @param dataSize
		  * @param clientSocket
		  * @return 
		  * 
		  */		
		 function onSocketRead(mainCmdID:uint,subCmdID:uint,buffer:ByteArray,dataSize:int,clientSocket:IClientSocket):Boolean;
		 /**
		  *网络关闭消息 
		  * @param clientSocket
		  * @param closeByServer
		  * @return 
		  */		 
		 function onSocketClose(clientSocket:IClientSocket,closeByServer:Boolean):Boolean;
		 /**
		  *socket 连接错误 
		  * @param clientSocket
		  * @param e
		  * @return 
		  * 
		  */		 
		 function onSocketError(clientSocket:IClientSocket,e :Event):Boolean;
	}
}